/*
 * TMap Designer - A Thematic Map design software
 * Copyright (C) 2006 World Health Organization
 * http://www.who.int
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
package who.tmap.digitizer.impl;

import gnu.io.SerialPort;
import who.tmap.digitizer.ConfigPair;

/**
 * Digitizer configuration information
 * @author stl
 *
 */
public interface DigitizerConfig {

	public static final ConfigPair[] STOP_BITS ={ new ConfigPairImpl( SerialPort.STOPBITS_1, "1" ), 
												  new ConfigPairImpl( SerialPort.STOPBITS_1_5, "1.5" ),
												  new ConfigPairImpl( SerialPort.STOPBITS_2, "2" ) };

	public static final ConfigPair[] DATA_BITS ={ new ConfigPairImpl( SerialPort.DATABITS_5, "5" ),
												  new ConfigPairImpl( SerialPort.DATABITS_6, "6" ),
												  new ConfigPairImpl( SerialPort.DATABITS_7, "7" ),
												  new ConfigPairImpl( SerialPort.DATABITS_8, "8" ) };

	public static final ConfigPair[] PARITY ={ new ConfigPairImpl( SerialPort.PARITY_EVEN, "Even" ),
											   new ConfigPairImpl( SerialPort.PARITY_MARK, "Mark" ),
											   new ConfigPairImpl( SerialPort.PARITY_NONE, "None" ),
											   new ConfigPairImpl( SerialPort.PARITY_ODD, "Odd" ),
											   new ConfigPairImpl( SerialPort.PARITY_SPACE, "Space" ) };

	public static final String[] BAUD_RATES ={ "50", "300", "600", "2400", "4800", "9600", "19200", "38400", "57600", "115200" };

	public static final ConfigPair[] LINE_SEPARATOR =new ConfigPair[] { new ConfigPairImpl( "\r\n", "Carriage-return + line feed" ),
													 					new ConfigPairImpl( "\n", "Line feed" ),
													 					new ConfigPairImpl( "", "Other" ) };

	public static final int OTHER_LINE_SEPARATOR_ID =2;

	public static final ConfigPair[] FIELD_SEPARATOR =new ConfigPair[] { new ConfigPairImpl( ";", "Semicolon" ),
																		 new ConfigPairImpl( ",", "Comma" ),
																		 new ConfigPairImpl( "\t", "Tab" ),																		 
																		 new ConfigPairImpl( "", "Other" ) };	

	public static final int OTHER_FIELD_SEPARATOR_ID =3;	
	
}
